package be.lreenaers.mirr0r.schema.components.SimpleDublinCore;

import java.util.ArrayList;

import javax.swing.BoxLayout;
import javax.swing.JPanel;

import be.lreenaers.mirr0r.components.utils.Utils;
import be.lreenaers.mirr0r.schema.components.GenericElement;
import be.lreenaers.mirr0r.schema.components.JdomElement;
import be.lreenaers.mirr0r.schema.interfaces.XmlAttribute;
import be.lreenaers.mirr0r.schema.interfaces.XmlElement;
/** 
 * Implement concept of Description according to <a href="http://purl.org/dc/elements/1.1/">http://purl.org/dc/elements/1.1/</a>.
 * 
 * @author Ludovic Reenaers
 * @version 1.0
 * @since 1.1
 */
public class DCXDescriptionElement extends GenericElement {
	/**
	 * Default Constructor.
	 */
	public DCXDescriptionElement(){
		setUp();
	}
	/**
	 * Builds the element up.
	 */
	public void setUp() {
		this.panel = new JPanel();
		BoxLayout layout=new BoxLayout(this.panel, BoxLayout.PAGE_AXIS);
		this.panel.setLayout(layout);
		this.attributes = new ArrayList<XmlAttribute>();
		this.elements = new ArrayList<XmlElement>();
		this.setName("description");
		this.element = new JdomElement("description");
		this.element.setNamespace(Utils.DCX_NAMESPACE);
		
		DCTitleElement dcTitle = new DCTitleElement();
		this.addElement(dcTitle);
		
		DCSubjectElement dcSubject = new DCSubjectElement();
		this.addElement(dcSubject);
		
		DCTypeElement dcType = new DCTypeElement();
		this.addElement(dcType);
		
		DCSourceElement dcSource = new DCSourceElement();
		this.addElement(dcSource);
		
		DCRightsElement dcRights = new DCRightsElement();
		this.addElement(dcRights);
		
		DCRelationElement dcRelation = new DCRelationElement();
		this.addElement(dcRelation);
		
		DCPublisherElement dcPublisher = new DCPublisherElement();
		this.addElement(dcPublisher);
		
		DCLanguageElement dcLanguage = new DCLanguageElement();
		this.addElement(dcLanguage);
		
		DCIdentifierElement dcIdentifier = new DCIdentifierElement();
		this.addElement(dcIdentifier);
		
		DCFormatElement dcFormat = new DCFormatElement();
		this.addElement(dcFormat);
		
		DCDescriptionElement dcDescription = new DCDescriptionElement();
		this.addElement(dcDescription);
		
		DCDateElement dcDate = new DCDateElement();
		this.addElement(dcDate);
		
		DCCreatorElement dcCreator = new DCCreatorElement();
		this.addElement(dcCreator);
		
		DCCoverageElement dcCoverage = new DCCoverageElement();
		this.addElement(dcCoverage);
		
		DCContributorElement dcContributor = new DCContributorElement();
		this.addElement(dcContributor);
	}

}
